<%@page import="java.util.ArrayList"%>
<%@page import="pl.org.waff.repository.*"%>
<%@page import="pl.org.waff.WaffServlet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String currentPath = WaffServlet.getCurrentPath((String) request.getAttribute(WaffServlet.PATH_ATTRIBUTE_NAME));
    String pathPrefix = (String) request.getSession().getAttribute(WaffServlet.PATH_PREFIX_ATTRIBUTE_NAME);
    String htmlFile;
    if("/".equals(currentPath)){
        htmlFile    = "/WEB-INF/content"  + "/text.jsp";
    }else{
        if(pathPrefix!=null&&pathPrefix.length()>0){
            currentPath=currentPath.substring(pathPrefix.length()-1);
        }
        htmlFile    = "/WEB-INF/content" + currentPath + "/text.jsp";
    }
%>
<%try {%>
<jsp:include page="<%=htmlFile%>" />
<%} catch (Exception e) { 
    // Attention!
    // When deployed on Google App Engine jsp:include to not existing page is handled differently then in local version
    // It's a problem to solve.
    //
    //you can print error message on screen
    String message="not found";
    out.print(message);
}%>